import request from '@/utils/request'

// 查询工单列表
export function listWorkorder(query) {
  return request({
    url: '/workorder/workorder/list',
    method: 'get',
    params: query
  })
}

// 查询工单详细
export function getWorkorder(woId) {
  return request({
    url: '/workorder/workorder/' + woId,
    method: 'get'
  })
}

// 新增工单
export function addWorkorder(data) {
  return request({
    url: '/workorder/workorder',
    method: 'post',
    data: data
  })
}

// 修改工单
export function updateWorkorder(data) {
  return request({
    url: '/workorder/workorder',
    method: 'put',
    data: data
  })
}

// 删除工单
export function delWorkorder(woId) {
  return request({
    url: '/workorder/workorder/' + woId,
    method: 'delete'
  })
}
// 项目和活动二级联动
export function getAct(projectId) {
  return request({
    url: '/workorder/workorder/getAct/'+ projectId,
    method: 'get',
  })
}
